1. Field of the Invention
The present invention relates to a firmware update method, and more particularly, to a safe and recoverable firmware update method using in an embedded electronic device and the embedded electronic device thereof.
2. Description of Related Art
Currently, embedded electronic devices may be updated with new firmware through manually downloading the new firmware from the Internet and later installing on the embedded electronic devices. Conventional firmware update methods include determining if there is a new version of firmware on a server downloadable via the Internet, then downloading the new version of firmware, and installing the designated embedded electronic devices. Besides, the conventional firmware update methods may have new firmware stored on one special storage device of the embedded electronic devices, set a flag for determining if an update is necessary, and clear the flag after a successful update of the firmware. In addition, it may also be done by determining whether a user presses a special key combination on the embedded electronic device, and by executing a firmware update process via a universal serial bus (USB) connection. Nonetheless, the conventional firmware update methods mostly involve directly downloading the new version of firmware to replace old version of firmware on the memory of the embedded electronic device. Without an appropriate backup mechanism, the embedded electronic device may not operate normally after the firmware update process if there occurs an abnormal event during the firmware update process or the process of writing the new firmware into the memory such as a device crash, a power outage, or a software defect in the new version of firmware. Most of the embedded electronic devices (e.g., a digital camera of a surveillance system installed around the wall) may not tolerate such a firmware update failure. Once the firmware update failure occurs, the embedded electronic device may not be re-booting properly, and also may no longer be able to carry out a new firmware update. However, it is normal to experience many different abnormal events during a development cycle of the embedded electronic device; therefore, there is need of a mechanism for safely updating firmware.
In order to prevent the embedded electronic device from not operating normally after the firmware update process, there are corresponding methods able to be applied such as using two sections of memory area for storing old version of firmware and new version of firmware separately, and through a special flag and a checksum to determine if the firmware update process is correct. If the firmware update failure occurs, the user may be able to drive the old version of firmware to re-boot the embedded electronic device through pressing a key or a key combination. In addition, the firmware update process may enter a special working mode such that a watchdog program set previously inside the embedded electronic device may drive the old version of firmware or a default firmware to re-boot the embedded electronic device when a preset timer expires in response to the firmware update failure. However, the above-described firmware update methods either require additional electronic circuits or hardware for realization, yet not guaranteeing the embedded electronic device successfully re-boot each time after the firmware update process, or require updating firmware through a manual way or by other means after the firmware update failure. Therefore, what is required is a method to safely update firmware for the embedded electronic device with a recoverable mechanism.